package cn.sangyy.gift.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;

@Data
@Document(indexName = "gift", type = "gift")
public class SpuGiftDoc {
    @Id
    private Long id;
    @Field(type = FieldType.Long)
    private Long spuId;
    @Field(type = FieldType.Keyword)
    private String cover;
    @Field(type = FieldType.Text, analyzer = "ik_smart"
            , searchAnalyzer = "ik_smart")
    private String name;
    @Field(type = FieldType.Long)
    private Long tenantId;
    @Field(type = FieldType.Text, analyzer = "ik_smart"
            , searchAnalyzer = "ik_smart")
    private String tenantName;
    @Field(type = FieldType.Long)
    private Long typeId;
    @Field(type = FieldType.Text, analyzer = "ik_smart"
            , searchAnalyzer = "ik_smart")
    private String typeName;
    private Long brandId;
    @Field(type = FieldType.Text, analyzer = "ik_smart"
            , searchAnalyzer = "ik_smart")
    private String brandName;
    @Field(type = FieldType.Integer)
    private Integer commentCount;
    @Field(type = FieldType.Integer)
    private Integer saleCount;
    @Field(type = FieldType.Date)
    private Date onSaleTime;
    @Field(type = FieldType.Date)
    private Date offSaleTime;
    @Field(type = FieldType.Double)
    private BigDecimal maxPrice;
    @Field(type = FieldType.Double)
    private BigDecimal minPrice;

    @Field(type = FieldType.Keyword)
    private String specProperties;
    @Field(type = FieldType.Keyword)
    private String skuProperties;

}